package com.wyb.controller;

import com.wyb.mapper.ArticleMapper;
import com.wyb.pojo.Article;
import com.wyb.constant.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/updatearticle")
public class UpdateArticleController {

    @Autowired
    private ArticleMapper articleMapper;

    @PostMapping
    public Result updateArticle(@RequestBody Article article){


        return articleMapper.updateById(article) != 0 ? new Result(200, "文章修改成功", null)
                                                        : new Result(201, "文章修改失败");
    }


}



